package com.gcph.zhuoba.main.common;
public class Constant {
	public static boolean IS_DEBUG=false;
	public static String server_root_url = "http://180.76.131.58:8080/pool/";
	
	//缩放比例
	public static float ratio;
	public static float ballRatio;
	//视图宽度
	public static int screenW;
	//视图高度
	public static int screenH;	
	
	//真实的球桌和球的尺寸内径 2540mmx1270mm 
	public static int deskInternalW = 2540;
	public static int deskInternalH = 1270;
	public static int deskW = 2790;//2840;
	public static int deskH = 1520;//1570;
	public static float ballH = 57.2f;
	
	//图片的球桌尺寸
	public static int imgDeskW = 555;//568;//2840;
	public static int imgDeskH = 303;//314;//1570;
	//图片的球台边框尺寸
	public static int imgDeskFrame = 25;//30;//150;
	//图片的球尺寸
	public static int imgBallDiameter= 24;
	
	//原点的偏移量
	public static float OFFSET_X = 0f;
	public static float OFFSET_Y = 0f;
	

	/** 是否:100000001=是 */
	public static final Integer GLOBAL_YESNO_YES = 100000001;
	/** 是否:100000002=否 */
	public static final Integer GLOBAL_YESNO_NO = 100000002;
	
	/** 资源类型:200000001=教案 */
	public static final Integer RESOURCE_TYPE_JIAOAN = 200000001;
	/** 资源类型:200000002=求助 */
	public static final Integer RESOURCE_TYPE_QIUZHU = 200000002;
	/** 资源类型:200000003=练习 */
	public static final Integer RESOURCE_TYPE_LIANXI = 200000003;
	/** 资源类型:200000004=解答 */
	public static final Integer RESOURCE_TYPE_JIEDA = 200000004;
	
	/** 资源小类型:200000101=走位 */
	public static final Integer RESOURCE_SMALL_TYPE_ZOUWEI = 200000101;
	/** 资源小类型:200000102=K球 */
	public static final Integer RESOURCE_SMALL_TYPE_KQIU = 200000102;
	/** 资源小类型:200000103=解球 */
	public static final Integer RESOURCE_SMALL_TYPE_JIEQIU = 200000103;
	/** 资源小类型:200000104=防守 */
	public static final Integer RESOURCE_SMALL_TYPE_FANGSHOU = 200000104;
	
	
	/** 元素类型 ：走位，停球区域 */
	public static final Integer ELEMENT_TYPE_ZOUWEI = 2;
	/** 元素类型 ：红包 */
	public static final Integer ELEMENT_TYPE_HONGBAO = 8;
	/** 元素类型 ：礼券 */
	public static final Integer ELEMENT_TYPE_LIJUAN = 9;
	/** 元素类型：雷区*/
	public static final Integer ELEMENT_TYPE_LEIQU = 10;
	/** 元素类型 ：炸药包 */
	public static final Integer ELEMENT_TYPE_ZAYAOBAO = 11;
	/** 元素类型 ：核弹*/
	public static final Integer ELEMENT_TYPE_HEDAN = 12;
	
	//接口操作代码
	//配对102，采集302
	public static final Integer SOCKET_METHOD_PAIR = 102;
	public static final Integer SOCKET_METHOD_DISCONNECT = 103;//断开连接
	public static final Integer SOCKET_METHOD_EXIT = 104;//退出
	public static final Integer SOCKET_METHOD_CLEAR = 105;//取消，清除台上元素
	//制作教案采集球型(四种类型的教案通用)
	public static final Integer SOCKET_METHOD_COLLECT = 302;
	//===========================走位教案开始=========================================
	public static final Integer SOCKET_METHOD_TEACHING_ZOUWEI = 3030;//选择走位教案
	//public static final Integer SOCKET_METHOD_TEACHING_ZOUWEI_ELEMENT = 303;//走位元素，摆放元素
	public static final Integer SOCKET_METHOD_TEACHING_ZOUWEI_SELECTEDBALL = 304;//选择目标球
	public static final Integer SOCKET_METHOD_TEACHING_ZOUWEI_SELECTEDBAG = 305;//选择进球袋
	//===========================K球教案开始=========================================
	public static final Integer SOCKET_METHOD_TEACHING_KQIU = 3060;//选择k球教案
	public static final Integer SOCKET_METHOD_TEACHING_KQIU_ELEMENT = 306;//选择k球教案，摆放元素
	public static final Integer SOCKET_METHOD_TEACHING_KQIU_SELECTEDBALL = 307;//选择目标球
	public static final Integer SOCKET_METHOD_TEACHING_KQIU_SELECTEDBAG = 308;//选择进球袋
	public static final Integer SOCKET_METHOD_TEACHING_KQIU_SELECTEKBALL = 309;//选择要k的球
	//===========================防守教案开始=========================================
	public static final Integer SOCKET_METHOD_TEACHING_FANGSHOU = 3100;//选择防守教案
	public static final Integer SOCKET_METHOD_TEACHING_FANGSHOU_ELEMENT = 310;//选择防守教案，摆放元素
	public static final Integer SOCKET_METHOD_TEACHING_FANGSHOU_SELECTEDBALL = 311;//选择目标球
	//===========================解球教案开始=========================================
	public static final Integer SOCKET_METHOD_TEACHING_JIEQIU = 3120;//选择解球教案
	public static final Integer SOCKET_METHOD_TEACHING_JIEQIU_ELEMENT = 312;//选择解球教案，摆放元素
	public static final Integer SOCKET_METHOD_TEACHING_JIEQIU_SELECTEDBALL = 313;//选择要解的球
	
	
	public static final Integer SOCKET_METHOD_COLLECT_ONLINEHELP = 502;
	//===========================走位求助开始=========================================
	public static final Integer SOCKET_METHOD_ONLINEHELP_ZOUWEI = 5040;//选择走位求助
	public static final Integer SOCKET_METHOD_ONLINEHELP_ZOUWEI_ELEMENT = 504;//走位元素，摆放元素
	public static final Integer SOCKET_METHOD_ONLINEHELP_ZOUWEI_SELECTEDBALL = 506;//选择目标球
	public static final Integer SOCKET_METHOD_ONLINEHELP_ZOUWEI_SELECTEDBAG = 505;//选择进球袋
	//===========================K球求助开始=========================================
	public static final Integer SOCKET_METHOD_ONLINEHELP_KQIU = 5080;//选择k球求助
	public static final Integer SOCKET_METHOD_ONLINEHELP_KQIU_ELEMENT = 5081;//选择k球求助，摆放元素
	public static final Integer SOCKET_METHOD_ONLINEHELP_KQIU_SELECTEDBALL = 508;//选择目标球
	public static final Integer SOCKET_METHOD_ONLINEHELP_KQIU_SELECTEDBAG = 507;//选择进球袋
	public static final Integer SOCKET_METHOD_ONLINEHELP_KQIU_SELECTEKBALL = 509;//选择要k的球
	//===========================防守求助开始=========================================
	public static final Integer SOCKET_METHOD_ONLINEHELP_FANGSHOU_ELEMENT = 510;//选择防守求助，摆放元素
	//===========================解球求助开始=========================================
	public static final Integer SOCKET_METHOD_ONLINEHELP_JIEQIU = 5110;//选择解球求助
	public static final Integer SOCKET_METHOD_ONLINEHELP_JIEQIU_ELEMENT = 5111;//选择解球求助，摆放元素
	public static final Integer SOCKET_METHOD_ONLINEHELP_JIEQIU_SELECTEDBALL = 511;//选择要解的球
	
	//试一下
	public static final Integer SOCKET_METHOD_TEST_ONLINEHELP = 512;
	
	//开始录像
	public static final Integer SOCKET_METHOD_BEGIN_VEDIO = 314;
	//重新录像
	public static final Integer SOCKET_METHOD_RE_VEDIO = 315;
	//上传录像
	public static final Integer SOCKET_METHOD_UPLOAD_VEDIO = 701;
	//上传成功
	public static final Integer SOCKET_METHOD_UPLOAD_SUCCESS = 702;
	//练习
	public static final Integer SOCKET_METHOD_PLAYER_PRACTICE = 401;
	public static final Integer SOCKET_METHOD_PRACTICE_LINE_SWITCH = 402;//练习线路开关
	public static final Integer SOCKET_METHOD_PLAYER_REPRACTICE = 403;//重新练习
	
	//解答
	public static final Integer SOCKET_METHOD_PLAYER_ANSWER = 601;
	//模仿
	public static final Integer SOCKET_METHOD_PLAYER_IMITATE = 602;
	//重新解答
	public static final Integer SOCKET_METHOD_PLAYER_REANSWER = 603;
	//重新模仿
	public static final Integer SOCKET_METHOD_PLAYER_REMITATE = 604;
	
	//模仿线路开关
	public static final Integer SOCKET_METHOD_IMITATE_SWITCH = 605;
	
	
	/**
	 * android 和投影仪的教案小类型 转换
	 * @param resourceSmallTypeZouwei
	 * @return
	 */
	public static int resourceSmallTypeTransform(Integer resourceSmallType)
	{
		if(RESOURCE_SMALL_TYPE_ZOUWEI.equals(resourceSmallType))
		{
			return 1;
		}else if(RESOURCE_SMALL_TYPE_KQIU.equals(resourceSmallType))
		{
			return 2;
		}else if(RESOURCE_SMALL_TYPE_JIEQIU.equals(resourceSmallType))
		{
			return 3;
		}else if(RESOURCE_SMALL_TYPE_FANGSHOU.equals(resourceSmallType))
		{
			return 4;
		}else
		{
			return 1;
		}
	}
	
	/**
	 * 生成资源 标签文字
	 * @param resourceType
	 * @param money
	 * @return
	 */
	public static String getResourceFlagText(Integer resourceType,String money)
	{
		String rType = null;
		if(RESOURCE_TYPE_JIAOAN.equals(resourceType))
		{
			rType = "炫";
		}else if(RESOURCE_TYPE_QIUZHU.equals(resourceType))
		{
			int _money = 0;
			try {
				_money=Integer.parseInt(money);
			} catch (Exception e) {
			}
			
			rType = "赏:"+_money;
		}else if(RESOURCE_TYPE_LIANXI.equals(resourceType))
		{
			rType = "练";
		}else if(RESOURCE_TYPE_JIEDA.equals(resourceType))
		{
			rType = "帮";
		}
		
		return rType;
	}
	
	
	/**
	 * 获得资源类型名称
	 * @param resourceType
	 * @param resourceSmallType
	 * @return
	 */
	public static String getResourceText(Integer resourceType,Integer resourceSmallType)
	{
		String rType = null;
		String smallType = null;
		if(RESOURCE_TYPE_JIAOAN.equals(resourceType))
		{
			rType = "教案";
		}else if(RESOURCE_TYPE_QIUZHU.equals(resourceType))
		{
			rType = "球助";
		}else if(RESOURCE_TYPE_LIANXI.equals(resourceType))
		{
			rType = "练习";
		}else if(RESOURCE_TYPE_JIEDA.equals(resourceType))
		{
			rType = "解答";
		}else
		{
			rType = "未";
		}
		
		if(RESOURCE_SMALL_TYPE_ZOUWEI.equals(resourceSmallType))
		{
			smallType = "走位";
		}else if(RESOURCE_SMALL_TYPE_KQIU.equals(resourceSmallType))
		{
			smallType = "K球";
		}else if(RESOURCE_SMALL_TYPE_JIEQIU.equals(resourceSmallType))
		{
			smallType = "解球";
		}else if(RESOURCE_SMALL_TYPE_FANGSHOU.equals(resourceSmallType))
		{
			smallType = "防守";
		}else
		{
			smallType = "未知";
		}
		return smallType+rType;
	}
}
